package com.leyou.configurations;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.File;

@Component
public class AppConstants {

    public static void main(String[] args) {
        System.out.println("a" + AppConstants.LINE_SEPARATOR);
        System.out.println(FILE_SEPARATOR);
    }

    /**
     * 系统换行符
     */
    public static final String LINE_SEPARATOR = System.getProperty("line.separator");
    /**
     * 目录风格符
     */
    public static final String FILE_SEPARATOR = File.separator;
    /**
     * 时间格式化字符串
     */
    public static final String[] TIME_PATTERN = new String[]{"yyyy-MM", "yyyyMM", "yyyy/MM", "yyyyMMdd", "yyyy-MM-dd", "yyyy/MM/dd", "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss"};

    /* -----------------------------------
     *        文件上传相关
     ----------------------------------- */


    public static String imgPath;

    @Value("${file.img-path}")
    public void setImgPath(String imgPath) {
        AppConstants.imgPath = imgPath;
    }

}
